# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=pngcheck
pkgver=3.0.3
pkgrel=1
groups=('blackarch' 'blackarch-stego' 'blackarch-defensive'
        'blackarch-forensic')
pkgdesc='Verifies the integrity of PNG, JNG and MNG files by checking the CRCs and decompressing the image data.'
arch=('x86_64' 'aarch64')
url='http://www.libpng.org/pub/png/apps/pngcheck.html'
license=('GPL')
depends=('libpng')
source=("http://www.libpng.org/pub/png/src/$pkgname-$pkgver.tar.gz")
sha512sums=('cdb2620cb508f9df748bd3e9cb657d2c503a1f62171f497f1ff1e0f220287364829f03164869567c83b5797d8bc478495ad6c35860196812ef8262fce4cbff26')

prepare() {
	cd "$pkgname-$pkgver"

  cp Makefile.unx Makefile
}

build() {
	cd "$pkgname-$pkgver"

  make
}

package() {
	cd "$pkgname-$pkgver"

  install -Dm 755 $pkgname "$pkgdir/usr/bin/$pkgname"
	install -Dm 755 pngsplit "$pkgdir/usr/bin/pngsplit"
	install -Dm 755 png-fix-IDAT-windowsize \
    "$pkgdir/usr/bin/png-fix-IDAT-windowsize"

  install -Dm 644 "$pkgname.1" "$pkgdir/usr/share/man/man1/$pkgname.1"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README CHANGELOG
}

